import {Injectable} from '@angular/core';
import {NHttpClinet} from '@core/utils/http.client';
import {TableFiled} from '@core/interfaces/table.interface';
import {BaseService} from '@core/utils/BaseRequest';
import {ResponseModel} from "@core/utils/ResponseModel";


@Injectable()
export class ChartsService extends BaseService {

  constructor(http: NHttpClinet) {
    super('user', http);
  }

  getQuestionNum(param: any) {
    return new Promise((resolve, reject) => {
      this.http.get(`${this.http.SERVER_URL}statistical/questionNum`, param).subscribe((response: ResponseModel) => {
        if (response.result === '00000000') {
          resolve(response.data);
        } else {
          //reject(result);
        }
      });
    });
  }


  getTotalData() {
    return new Promise((resolve, reject) => {
      this.http.get(`${this.http.SERVER_URL}statistical/totalData`).subscribe((response: ResponseModel) => {
        if (response.result === '00000000') {
          resolve(response.data);
        } else {
          //reject(result);
        }
      });
    });
  }
}
